<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ include file="base.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=GBK" />
	<title>文档-${document.title}</title>
	<link rel="stylesheet" type="text/css" href="style/reset.css" media="all" />
	<link rel="stylesheet" type="text/css" href="style/layout.css" media="all" />
	<link rel="stylesheet" type="text/css" href="style/invalid.css" media="all" />
	<link rel="stylesheet" type="text/css" href="style/style.css" media="all" />
	<script type="text/javascript" src="script/jquery-1.4.3.min.js"></script>
	<script type="text/javascript" src="script/jquery.mousewheel-3.0.4.pack.js"></script>
	<script type="text/javascript" src="script/jquery.tipTip.minified.js"></script>
	<script type="text/javascript" src="script/kindeditor/kindeditor.js"></script>
	<script type="text/javascript" src="script/simpla.js"></script>
	<script type="text/javascript">
		$(document).ready(function(){
			$("#main-nav-a-list").addClass("current");
			$("#main-nav-a-list").next("ul").show();
			$("#edit").click(function(){
				$("#doc-content").hide();
				$("#doc-edit").show();
			});
			$("#cancel-edit").click(function(){
				$("#doc-edit").hide();
				$("#doc-content").show();
			});
			$("#subbutton").click(function(){
				var title = $("#documenttitle").val();
				var content = $("#documentcontent").val();
				if(title.trim().length == 0) {
					$("#notifyMessage div").html("请输入标题！").parent().slideDown().show().fadeTo(400,1);
				} else if(content.trim().length == 0) {
					$("#notifyMessage div").html("请输入内容！").parent().slideDown().show().fadeTo(400,1);
				} else {
					$("#docform").submit();
				}
			});
		});
	</script>
	<script>
		KE.show({
			id : 'documentcontent',
			resizeMode : 1,
			allowPreviewEmoticons : false,
			allowUpload : false,
			syncType : 'auto',
			items : [
			'fontname', 'fontsize', '|', 'textcolor', 'bgcolor', 'bold', 'italic', 'underline',
			'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
			'insertunorderedlist', '|', 'emoticons', 'image', 'link']
		});
	</script>
</head>
<body>
	<div id="body-wrapper">
		<!-- sidebar开始 -->
		<%@ include file="left.jsp" %>
		<!-- sidebar结束 -->
		<!-- main-content开始 -->
		<div id="main-content">
			<div class="content-box closed-box">
				<div class="content-box-header">
					<h3><a href="index.jspx">首页</a>&gt<a href="${basePath}/project.jspx?id=${document.project.id}">${document.project.name}</a>&gt 
						${document.title}
					</h3>
				</div>
			</div>
			
			<!-- 文档内容开始开始 -->
			<div id="newissues">
				<div class="content-box">
					<div class="content-box-header">
						<h3 id="newih">${document.title}</h3>
					</div>
					<div id="doc-content" class="content-box-content">
						${document.content}
						<div class="clear"></div>
						<div class="mtop">
							<input id="edit" type="button" class="button right" value="编辑"/>
						</div>
						<div class="clear"></div>
					</div>
					<div id="doc-edit" class="content-box-content" style="display: none;">
						<!-- 错误消息开始 -->
						<div id="notifyMessage" class="notification attention png_bg" style="opacity: 0; display: none;">
							<a class="close" href="#">
								<img alt="close" title="Close this notification" src="${basePath }/images/cross_grey_small.png" />
							</a>
							<div>
							</div>
						</div>
						<!-- 错误消息结束 -->
						<form id="docform" action="document!save.jspx" method="post">
							<input type="hidden" name="project.id" value="${document.project.id}" />
							<input type="hidden" name="document.id" value="${document.id}"/>
							<div>
								<label for="documenttitle">标题</label>
								<input type="text" class="full" name="document.title" id="documenttitle" value="${document.title}"/>
							</div>
							<div class="clear"></div>
							<div>
								<label for="documentcontent">内容</label>
								<textarea id="documentcontent" name="document.content" style="height: 300px;width: 800px;">${document.content}</textarea>
							</div>
							<div class="clear"></div>
							<div class="mtop">
								<input id="cancel-edit" type="button" class="button right mleft" value="取消"/>
								<input id="subbutton" type="button" class="button right" value="提交" />
							</div>
						</form>
						<div class="clear"></div>
					</div>
				</div>
			</div>
			<!-- 文档内容结束结束 -->
			<%@include file="foot.jsp" %>
		</div>
		<!-- main-content结束 -->
	</div>
</body>
</html>

